/**
   A class to process names.
*/
public class Names
{
   /**
      Turns a name "First Last" into a name "Last, First"
      @param firstLast a name such as "Harry Smith", with a space separating
      the first and last name.
      @return a name such as "Smith, Harry", with the last name followed by
      a comma, a space, and the first name.
   */
   public String getLastFirst(String firstLast)
   {
      int firstLen = 0;
      for(int i = 0; i < firstLast.length(); i ++) {
         if(firstLast.charAt(i) != ' ') firstLen ++;
         else break;
      }
      String firstName = new String();
      String lastName = new String();
      String newName = new String();
      firstName = firstLast.substring(0,firstLen);
      lastName = firstLast.substring(firstLen+1,firstLast.length());
      newName = lastName.concat(", ").concat(firstName);
      return newName;
   }
}